/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.afcepf.projet2.test;

import javaapplication2.webservice.AdresseDto;
import javaapplication2.webservice.Catalogue;
import javaapplication2.webservice.ExceptionCatalogue_Exception;
import javaapplication2.webservice.ExceptionCategorie_Exception;
import javaapplication2.webservice.ExceptionSiteInconnu_Exception;
import javaapplication2.webservice.InformationManquanteExceptionException;
import javaapplication2.webservice.MotDePasseIncorrectExceptionException;
import javaapplication2.webservice.UtilisateurDto;
import javaapplication2.webservice.UtilisateurInexistantExceptionException;
import javaapplication2.webservice.WsFacade;
import javaapplication2.webservice.WsFacade_Service;

/**
 *
 * @author Sylvain
 */
public final class AppelsWebService {

    public static Catalogue creationCatalogue(final String site) 
            throws ExceptionSiteInconnu_Exception, ExceptionCatalogue_Exception,
            ExceptionCategorie_Exception {
        WsFacade_Service service = new WsFacade_Service();
       WsFacade port = service.getWsFacadePort();
        return port.creationCatalogue(site);
    }

    public static UtilisateurDto getClientByEmail(final String email)
            throws InformationManquanteExceptionException,
            UtilisateurInexistantExceptionException {
        WsFacade_Service service = new WsFacade_Service();
        WsFacade port = service.getWsFacadePort();
        return port.getClientByEmail(email);
    }

    public static UtilisateurDto getClientById(final int arg0)
            throws UtilisateurInexistantExceptionException{
        WsFacade_Service service = new WsFacade_Service();
        WsFacade port = service.getWsFacadePort();
        return port.getClientById(arg0);
    }

    public static UtilisateurDto login(final String login, 
            final String password) 
            throws InformationManquanteExceptionException,
            MotDePasseIncorrectExceptionException,
            UtilisateurInexistantExceptionException {
        WsFacade_Service service = new WsFacade_Service();
        WsFacade port = service.getWsFacadePort();
        return port.login(login, password);
    }

    public static void modifierClient(final UtilisateurDto client) {
        WsFacade_Service service = new WsFacade_Service();
        WsFacade port = service.getWsFacadePort();
        port.modifierClient(client);
    }

    public static UtilisateurDto ajoutClient(final UtilisateurDto client, 
            final AdresseDto adresse, final String civilite) 
            throws InformationManquanteExceptionException {
        WsFacade_Service service = new WsFacade_Service();
        WsFacade port = service.getWsFacadePort();
        return port.ajoutClient(client, adresse, civilite);
    }
}
